/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ru.bashsoft.nero.nameparser;

/**
 *
 * @author nero
 */
public class Player {
    public String name;
    public String nation;
    
     @Override 
     public boolean equals(Object other) {
         if (other == null) return false;
         if (!(other instanceof Player)) return false;
         Player otherPlayer = (Player)other;
         boolean result = true;
         if ((this.name == null) || (otherPlayer.name == null))
             result = result && (this.name == null) && (otherPlayer.name == null);
         else
             result = result && (this.name.equals(otherPlayer.name));
         if ((this.nation == null) || (otherPlayer.nation == null))
             result = result && (this.nation == null) && (otherPlayer.nation == null);
         else
             result = result && (this.nation.equals(otherPlayer.nation));
         return result;
     }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 97 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 97 * hash + (this.nation != null ? this.nation.hashCode() : 0);
        return hash;
    }
   
    @Override
    public String toString() {
        return this.name;
    }
}
